function palindrome(str) {
    str = str.toLowerCase().replace(/\W+|_/g, '');
    let rev = str.split('').reverse().join('');
    return str === rev;
}

console.log(palindrome("eye"));
console.log(palindrome("Eye_"));
